﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using SPPD.model;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using NHibernate.Linq;
using SPPD.controller;

namespace SPPD
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
           
            InitializeComponent();
            nhibernate nhi = new nhibernate();
            nhi.createTable();
        }

        private void passwordBox1_PasswordChanged(object sender, RoutedEventArgs e)
        {
            
           
        }

        private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            int find;
            //controller_login log = new controller_login();
            //find = log.login(textBox1.Text);
            find = int.Parse(textBox1.Text);
            if (find == 0) { MessageBox.Show("username atau password salah"); return; } 
            else if (find == 1)
            {
                Window2 manajer = new Window2();
                this.Hide();
                manajer.Show();
            }
            else
                if (find == 2)
                {
                    Window1 bendahara = new Window1();
                    this.Hide();
                    bendahara.Show();
                }
                else
                    if (find == 3)
                    {
                        Window3 aju = new Window3();
                        this.Hide();
                        aju.Show();
                    }
                    else
                        if (find == 4)
                        {
                            sppd_form n = new sppd_form();
                            this.Hide();
                            n.Show();
                        }
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            form_pengajuan fp = new form_pengajuan();
            this.Hide();
            fp.Show();
        }
    }
}
